/**
 * 
 */
package instructions;
import dataCPU.*;

/**
 * @author dt08nu0
 *
 */
public class JumpEq extends Jump {

	/**
	 * 
	 */
	Data data1, data2;
	public JumpEq(int index, Data data1, Data data2) {
		super(index);
	}

    public String toString() {
	return "JEQ "+index+" "+data1.toString()+" "+data2.toString();
    }
	
	public void execute(Memory memory,  Integer programCounter) {
		//compares data1 with data2, if equals super.execute();
	    if (data1.equals(data2))
		programCounter = index;
		
	}

}
